{% extends "base_cn.html" %}
{% block content %}
<script type="text/javascript" src="/static/javascripts/xms_cn.js"></script>
    <ins>{%if show_incomes%}收入清单{%endif%}{%if show_payouts%}支出清单{%endif%} : 共{{details.count}}条记录!
    <br/></ins>
    {% include 'pager_cn.html' %}
    <table class="datalist" cellpadding="2" cellspacing="0" style="width:700px;">
    <tr>
      <th style="width:100px;"><span>日期</span></th>
      <th style="width:60px;"><span>金额</span></th>
      <th style="width:80px;"><span>姓名</span></th>
      <th><span>说明</span></th>
      {%if show_incomes%}
      <th style="width:80px;"><span>提交者</span></th>
      {%endif%}
      {%if show_payouts%}
      <th style="width:80px;"><span>提交者</span></th>
      <th style="width:50px;"><span>已报销?</span></th>
      <th style="width:80px;"><span>批准者</span></th>
      {%endif%}
      {%if isAdmin%}
      <th style="width:50px;"><span>操作</span></th>
      {%endif%}
    </tr>
    {% for item in details.entries %}
    <tr class={%if forloop.counter0|divisibleby:2 %}"alternation"{%else%}"seperation"{%endif%}>
      <td>{{item.Datetime|date:"Y-m-d" }}</td>
      <td>{{item.Money|floatformat:2}}</td>
      <td>{{item.User.NickName|escape}}</td>
      <td><span>{{item.Details|escape}}</span></td>
      {%if show_incomes%}
      <td>{{item.Submiter.NickName|escape}}</td>
      {%endif%}
      {%if show_payouts%}
      <td>
      {{item.Submiter.NickName|escape}}
      </td>
      <td><input type="checkbox" {%if item.IsPay %}checked="checked"{%endif%} disabled="disabled"/>
      {%if item.IsPay%}是{%else%}否{%endif%}
      </td>
      <td>
      {%if item.IsPay%}
      {{item.Approver.NickName|escape}}
      {%endif%}
      </td>
      {%endif%}
      {%if isAdmin%}
        <td>
        {%if show_incomes%}
        <a href="/groupaction/delincome/{{item.key}}/">删除</a>
        {%endif%}
        {%if show_payouts%}
        <a href="/groupaction/delpayout/{{item.key}}/">删除</a>
        {%endif%}
        </td>
      {%endif%}
    </tr>
    {% endfor %}
    <tr><td colspan="4">
    <div>
    <form id="allgroups" method="post" action=""><div>
           排序 :&nbsp;按
    <select name="sort"> 
    <option {%ifequal sort 'Datetime' %}selected="selected"{%endifequal%} value="Datetime">日期</option>
    <option {%ifequal sort 'Money' %}selected="selected"{%endifequal%} value="Money">金额</option>
    <option {%ifequal sort 'User' %}selected="selected"{%endifequal%} value="User">姓名</option>
    <option {%ifequal sort 'Submiter' %}selected="selected"{%endifequal%} value="Submiter">提交者</option>
    {%if show_payouts%}
    <option {%ifequal sort 'IsPay' %}selected="selected"{%endifequal%} value="IsPay">已报销?</option>
    <option {%ifequal sort 'Approver' %}selected="selected"{%endifequal%} value="Approver">批准者</option>
    {%endif%}
    </select>
    &nbsp;
    <select name="order">
    <option {%ifequal order '-' %}selected="selected"{%endifequal%} value="-">从大到小</option>
    <option {%ifequal order '' %}selected="selected"{%endifequal%} value="">从小到大</option>
    </select>
    <input id="submit" type="submit" value="查看"/> </div></form>
    </div>
    </td>
    <td colspan="2">
    {%if show_incomes%}
    <a href="/excel/incomes/">
    {%endif%}
    {%if show_payouts%}
    <a href="/excel/payouts/">
    {%endif%}
    <img style="vertical-align:middle" alt="Excel" src="/static/images/excel.gif"/>导出Excel文件
    </a></td>
    </tr>
    </table>

{% endblock %}
